package cn.itcast.i18n;

import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;

public class Demo5 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String pattern = "At {0, time, short} on {0, date}, a destroyed {1} houses and caused {2, number, currency} of damage.";
		
		MessageFormat format = new MessageFormat(pattern,Locale.US);
		Object arr[] = {new java.util.Date(),99,10000000};
		String result = format.format(arr);
		System.out.println(result);
		
		
		
		ResourceBundle bundle = ResourceBundle.getBundle("cn.itcast.resource.myproperties",Locale.CHINA);
		pattern = bundle.getString("message");
		
		format = new MessageFormat(pattern,Locale.CHINA);
		arr = new Object[]{new java.util.Date(),99,10000000};
		result = format.format(arr);
		System.out.println(result);
		
		
		

	}

}
